package com.gumanx;

import java.util.Iterator;
import java.util.List;

import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemPotion;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;

public class ItemPotionNitricAcid extends ItemPotion {

	public ItemPotionNitricAcid(int par1) {
		super(par1);
		this.setCreativeTab(CreativeTabs.tabBrewing);
	}
	
	public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
    {
        if (!par3EntityPlayer.capabilities.isCreativeMode)
        {
            --par1ItemStack.stackSize;
        }

		par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.harm.id, 50));
		par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.wither.id, 1000));

        if (!par3EntityPlayer.capabilities.isCreativeMode)
        {
            if (par1ItemStack.stackSize <= 0)
            {
                return new ItemStack(Item.glassBottle);
            }

            par3EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.glassBottle));
        }

        return par1ItemStack;
    }
	
	public void RegisterIcons(IconRegister iconReg){
		itemIcon = iconReg.registerIcon("gumanx:nitricAcid");
	}
}
